In [2]:
import numpy as np
import matplotlib as mpl
import matplotlib.pylab as plt
import seaborn as sns
%matplotlib inline
sns.set()
sns.set_context('poster')
sns.set_style('ticks')

In [3]:
def free_probs(N):
    return np.power(np.cos(np.arange(N+1)*.5*np.pi/N),2)
def power_cos_free(n,N):
    if n > N:
        raise ValueError("n = {n} cannot be greater than N = {N}".format(n=n,N=N))
    return np.cos(n*.5*np.pi/N)**(2)
def power_cos(n,N):
    if n > N:
        raise ValueError("n = {n} cannot be greater than N = {N}".format(n=n,N=N))
    return np.cos(.5*np.pi/N)**(2*n)
def gauss_state(x,x0,sigma):
    return np.power((2*np.pi*sigma**2),-1/4)*np.exp(-1*np.power(x-x0,2)/(4*sigma**2))
def zeno_probs(N):
    return np.power(np.cos(.5*np.pi/N)**2,np.arange(N+1))
def dot_data(ndots,sigma,N,xspace,yspace,y0,probf):
    ztot = 0
    for n in range(ndots):
        zeno_amp = probf(n,N)
        xvals = zeno_amp*np.power(gauss_state(xspace,10*n*sigma,sigma),2)
        yvals = np.power(gauss_state(yspace,y0,sigma),2)
        ztot += np.outer(yvals,xvals)
    return ztot

Free Evolution


In [4]:
f,axarr =  plt.subplots(nrows=2,ncols=2,figsize=(12,8))
for (p,arr) in zip(range(1,5),axarr.ravel()):
    probs = free_probs(10**p)
    #arr.plot(probs)
    arr.plot(probs,'o',markersize=5)
    arr.set_title(r"N = {0}".format(10**p))
    arr.set_xlabel(r"$Circulations$")
    arr.set_ylabel(r"$P_n(V)$")
f.tight_layout()
f.suptitle("No Postselection",y=1.04)
f.savefig("q_free_zeno_effect.png",dpi=f.dpi)



In [5]:
f = plt.figure()
sigma = 4
total_dots = 11
total_steps = 1
X = np.arange(-5*sigma, total_dots*(10)*sigma-5*sigma, 0.25)
Y = np.arange(-5*sigma, total_steps*10*sigma-5*sigma, 0.25)
Z = 0
n = 0
for N in np.power(10,np.array([1,5])):
    Z += dot_data(total_dots,sigma,N,X,Y,10*n*sigma,power_cos_free)
    n += 1
# Plot the surface.
plt.imshow(Z, cmap=mpl.cm.afmhot,origin='lower',extent=[-5*sigma,total_dots*10*sigma-5*sigma,-5*sigma,total_steps*10*sigma-5*sigma],vmin=0.6*np.max(Z),vmax = .9*np.max(Z))
xlabels_p = 10*np.arange(0,total_dots)*sigma
xlabels_s = range(total_dots)
ylabels_p = 10*np.arange(0,total_steps)*sigma
ylabels_s = np.power(10,np.array([1,5]))
plt.xticks(xlabels_p,xlabels_s)
plt.yticks(ylabels_p,ylabels_s)
plt.xlabel(r"$circulations\ (n)$")
plt.ylabel(r"$N$")
plt.title(r"No Postselection - $P_n(V)$",y=1.09)
f.savefig("q_free_zeno_effect_dots.png",dpi=f.dpi,bbox_inches='tight')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-c6b2598bb6aa> in <module>()
     11     n += 1
     12 # Plot the surface.
---> 13 plt.imshow(Z, cmap=mpl.cm.afmhot,origin='lower',extent=[-5*sigma,total_dots*10*sigma-5*sigma,-5*sigma,total_steps*10*sigma-5*sigma],vmin=0.6*np.max(Z),vmax = .9*np.max(Z))
     14 xlabels_p = 10*np.arange(0,total_dots)*sigma
     15 xlabels_s = range(total_dots)

NameError: name 'mpl' is not defined
<matplotlib.figure.Figure at 0xcb71b70>

Quantum Zeno Effect


In [ ]:
f,axarr =  plt.subplots(nrows=2,ncols=2,figsize=(12,8))
for (p,arr) in zip(range(1,5),axarr.ravel()):
    probs = zeno_probs(10**p)
    #arr.plot(probs)
    arr.plot(probs,'o',markersize=5)
    if p == 1:
        arr.set_ylim(0.65,1.05)
    else:
        arr.set_ylim(0.9,1.05)
    arr.set_title(r"N = {0}".format(10**p))
    arr.set_xlabel(r"$Circulations$")
    arr.set_ylabel(r"$P_n(V)$")
f.tight_layout()
f.suptitle("Quantum Zeno Effect",y=1.04)
f.savefig("q_zeno_effect.png",dpi=2*f.dpi)

In [ ]:
f = plt.figure()
sigma = 4
total_dots = 11
total_steps = 2
X = np.arange(-5*sigma, total_dots*10*sigma-5*sigma, 0.25)
Y = np.arange(-5*sigma, total_steps*10*sigma-5*sigma, 0.25)
Z = 0
n = 0
for N in np.power(10,np.array([1,5])):
    Z += dot_data(total_dots,sigma,N,X,Y,10*n*sigma,power_cos)
    n += 1
# Plot the surface.
plt.imshow(Z, cmap=mpl.cm.afmhot,origin='lower',extent=[-5*sigma,total_dots*10*sigma-5*sigma,-5*sigma,total_steps*10*sigma-5*sigma],vmin=0.6*np.max(Z),vmax = .9*np.max(Z))
xlabels_p = 10*np.arange(0,total_dots)*sigma
xlabels_s = range(total_dots)
ylabels_p = 10*np.arange(0,total_steps)*sigma
ylabels_s = np.power(10,np.array([1,5]))
plt.xticks(xlabels_p,xlabels_s)
plt.yticks(ylabels_p,ylabels_s)
plt.xlabel(r"$circulations$")
plt.ylabel(r"$N$")
plt.title(r"Quantum Zeno Effect - $P_n(V)$",y=1.09)
f.savefig("q_zeno_effect_dots.png",dpi=f.dpi,bbox_inches='tight')

In [ ]:


In [ ]: